package com.ruoyi.yijing.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yijing.mapper.YjGuaiFamousMapper;
import com.ruoyi.yijing.domain.YjGuaFamous;
import com.ruoyi.yijing.service.IYjGuaiFamousService;

/**
 * 名人说卦Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class YjGuaiFamousServiceImpl implements IYjGuaiFamousService 
{
    @Autowired
    private YjGuaiFamousMapper yjGuaiFamousMapper;

    /**
     * 查询名人说卦
     * 
     * @param id 名人说卦主键
     * @return 名人说卦
     */
    @Override
    public YjGuaFamous selectYjGuaiFamousById(Long id)
    {
        return yjGuaiFamousMapper.selectYjGuaiFamousById(id);
    }

    /**
     * 查询名人说卦列表
     * 
     * @param yjGuaiFamous 名人说卦
     * @return 名人说卦
     */
    @Override
    public List<YjGuaFamous> selectYjGuaiFamousList(YjGuaFamous yjGuaiFamous)
    {
        return yjGuaiFamousMapper.selectYjGuaiFamousList(yjGuaiFamous);
    }

    /**
     * 新增名人说卦
     * 
     * @param yjGuaiFamous 名人说卦
     * @return 结果
     */
    @Override
    public int insertYjGuaiFamous(YjGuaFamous yjGuaiFamous)
    {
        yjGuaiFamous.setCreateBy(SecurityUtils.getUsername());
        yjGuaiFamous.setCreateTime(new Date());
        return yjGuaiFamousMapper.insertYjGuaiFamous(yjGuaiFamous);
    }

    /**
     * 修改名人说卦
     * 
     * @param yjGuaiFamous 名人说卦
     * @return 结果
     */
    @Override
    public int updateYjGuaiFamous(YjGuaFamous yjGuaiFamous)
    {
        yjGuaiFamous.setUpdateBy(SecurityUtils.getUsername());
        yjGuaiFamous.setUpdateTime(new Date());
        return yjGuaiFamousMapper.updateYjGuaiFamous(yjGuaiFamous);
    }

    /**
     * 批量删除名人说卦
     * 
     * @param ids 需要删除的名人说卦主键
     * @return 结果
     */
    @Override
    public int deleteYjGuaiFamousByIds(Long[] ids)
    {
        return yjGuaiFamousMapper.deleteYjGuaiFamousByIds(ids);
    }

    /**
     * 删除名人说卦信息
     * 
     * @param id 名人说卦主键
     * @return 结果
     */
    @Override
    public int deleteYjGuaiFamousById(Long id)
    {
        return yjGuaiFamousMapper.deleteYjGuaiFamousById(id);
    }
}
